package bz.ziro.kanbe.controller.mng.mail;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.datastore.Datastore;

import bz.ziro.kanbe.dao.MailDao;
import bz.ziro.kanbe.model.Mail;

/**
 * メール設定の削除
 * @author Administrator
 *
 */
public class DeleteController extends Controller {

    @Override
    public Navigation run() {

    	String siteKeyBuf = sessionScope("siteKey");
    	String pageKeyBuf = requestScope("parentPage");
    	//メール設定を検索
    	Mail mail = MailDao.findParentPageKey(Long.valueOf(siteKeyBuf),Long.valueOf(pageKeyBuf));
    	//削除
    	Datastore.delete(mail.getKey());
        return null;
    }
}
